package com.erik.thread_Exe.e02;

public class Letter implements Runnable{


    char letter[]=new char[26];

    Letter(){
        for(int i =0;i<26;i++){
            letter[i]= (char) ('a'+i);
        }
    }

    @Override
    public void run() {
        System.out.print("| ");
        for(int i=0;i<26;i++){
            try {
                Thread.sleep(1000); //线程休眠1000ms（1s）
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            System.out.print(letter[i]+" | ");
            if ((i+1)%4==0) {
                System.out.println();
                System.out.println("——————————————————");
                System.out.print("| ");
            }
        }
    }
}
